import myAxios from "../request/myAxios";

export const getCurrentUser = async () => {
    // const currentUser = getCurrentUserState();
    //如果当前用户存在，直接返回
    // if (currentUser) {
    //     return currentUser;
    // }
    //不存在从远程获取
    const res = await myAxios.get('user/current');
    if (res.data.code === 0) {
        return res.data.data;
    }
    return null;
}
